#!/usr/bin/env python

import wx

import resource.toolbar as toolbar

class MenuBar(wx.MenuBar):
    '''MenuBar class
    
    @author Julot <andy.julot@gmail.com>
    @since Wednesday, January 25, 2012. 08:15 PM'''
    
    def __init__(self, *args, **kwargs):
        wx.MenuBar.__init__(self, *args, **kwargs)
        self.file = File()
        self.Append(self.file, '&File')
        self.aniDb = AniDb()
        self.Append(self.aniDb, '&AniDb')
        self.help = Help()
        self.Append(self.help, '&Help')

class File(wx.Menu):
    '''File class
    
    @author Julot <andy.julot@gmail.com>
    @since Wednesday, January 25, 2012. 08:20 PM'''
    
    def __init__(self, *args, **kwargs):
        wx.Menu.__init__(self, *args, **kwargs)
        
        self.mold = wx.MenuItem(self, -1, '&Print\tCtrl+P',
                                'Print CD Back Cover')
        self.mold.Bitmap = toolbar.Printer.Bitmap
        self.AppendItem(self.mold)
        self.mold.Enable(False)
        
        self.printPreview = wx.MenuItem(self, -1, '&Print Preview',
                                        'Print Preview CD Back Cover')
        self.printPreview.Bitmap = toolbar.DocumentSearchResult.Bitmap
        self.AppendItem(self.printPreview)
        self.printPreview.Enable(False)
        
        self.printerSettings = wx.MenuItem(self, -1, 'Printer Settings...',
                                     'Printer settings...')
        self.printerSettings.Bitmap = toolbar.PrinterPencil.Bitmap
        self.AppendItem(self.printerSettings)
        
        self.AppendSeparator()
        
        self.close = wx.MenuItem(self, -1, '&Quit\tCtrl+Q',
                                 'Close the application')
        self.close.Bitmap = toolbar.DoorOpenOut.Bitmap
        self.AppendItem(self.close)

class AniDb(wx.Menu):
    '''AniDb class
    
    @author Julot <andy.julot@gmail.com>
    @since Sunday, January 29, 2012. 10:31 PM'''
    
    def __init__(self, *args, **kwargs):
        wx.Menu.__init__(self, *args, **kwargs)
        s = 'Download AniDb XML file.'
        self.downloadXml = wx.MenuItem(self, -1, 'Download XML\tCtrl+D', s)
        self.downloadXml.Bitmap = toolbar.DocumentXaml.Bitmap
        self.AppendItem(self.downloadXml)
        self.downloadXml.Enable(False)
        s = 'Download AniDb image file.'
        self.downloadImage = wx.MenuItem(self, -1, 'Download Image', s)
        self.downloadImage.Bitmap = toolbar.ImageVertical.Bitmap
        self.AppendItem(self.downloadImage)
        self.downloadImage.Enable(False)
        self.AppendSeparator()
        s = 'Import AniDb XML Titles'
        self.importTitles = wx.MenuItem(self, -1, 'Import Titles', s)
        self.importTitles.Bitmap = toolbar.DocumentImport.Bitmap
        self.AppendItem(self.importTitles)
    
    
class Help(wx.Menu):
    '''Help class
    
    @author Julot <andy.julot@gmail.com>
    @since Wednesday, January 25, 2012. 08:22 PM'''
    
    def __init__(self, *args, **kwargs):
        wx.Menu.__init__(self, *args, **kwargs)
        
        self.index = wx.MenuItem(self, -1, '&Index\tF1', 'Index')
        self.index.Bitmap = toolbar.QuestionButton.Bitmap
        self.AppendItem(self.index)
        
        self.AppendSeparator()
        
        self.about = wx.MenuItem(self, -1, '&About', 'About')
        self.about.Bitmap = toolbar.About.Bitmap
        self.AppendItem(self.about)
    